package com.hiwhitley.easy.day26;

/**
 * Created by hiwhitley on 2016/10/25.
 */
public class ExcelSheetColumnTitle_168 {
    public String convertToTitle(int n) {
        String ret = "";
        while (n != 0) {
            ret = (char) ((n - 1) % 26 + 'A') + ret;
            n = (n - 1) / 26;
        }

        return ret;
    }

    public static void main(String[] args) {
        ExcelSheetColumnTitle_168 main = new ExcelSheetColumnTitle_168();
        System.out.println(main.convertToTitle(26));
    }
}
